ScxV6Object.ConvertTemplate Method

Converts a template instance from one template to another.

Parameters

Remarks

This method will convert all of the objects within an instance to the class of any matching objects in the new template. Any objects which do not exist in the new template will be deleted. Any objects which didn't exist in the old template will be created.

Example:

The following example written in VB.NET converts the instance from one template to another.

Dim Svr As ScxV6DbClient.ScxV6Server

Svr = New ScxV6DbClient.ScxV6Server

Svr.Connect("MAIN", "D", "")

Dim Obj As ScxV6DbClient.ScxV6Object

Obj = Svr.FindObject("Group.Instance")

Dim NewTemplate As ScxV6DbClient.ScxV6Object

NewTemplate = Svr.FindObject("Group.Point Template 2")

Try

Obj.ConvertTemplate(NewTemplate.ID, False)

Catch ex As System.Runtime.InteropServices.COMException

If (MsgBox(ex.Message + " Attempt to convert anyway?", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok) Then

Obj.ConvertTemplate(NewTemplate.ID, True)

End If

End Try

' Disconnect

Svr.Disconnect()


Disclaimer

Geo SCADA Expert 2020